/**
 * 
 */
package edu.gatech.oad.mule.input;

/**
 * Represents a single input event from a user.
 * 
 * @author Dale Avery
 * 
 */
public final class InputEvent {

	/**
	 * Represents all possible types of input events that can be received from a
	 * user.
	 * 
	 * @author Dale Avery
	 * 
	 */
	public static enum ButtonPress {
		UP, DOWN, LEFT, RIGHT, ACTION, ERROR
	};

	private ButtonPress press;

	/**
	 * Constructs a new InputEvent with a given button press.
	 * 
	 * @param press
	 *            The button press that will be associated with this event.
	 * @throws Exception
	 *             Thrown if null is passed into constructor.
	 */
	public InputEvent(ButtonPress press) {
		if (press == null) {
			press = ButtonPress.ERROR;
		} else {
			this.press = press;
		}
	}

	/**
	 * @return The button press for this event.
	 */
	public ButtonPress getPress() {
		return press;
	}

	@Override
	public String toString() {
		return press.toString();
	}
}
